﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using FancyBattles.GameEntities;

namespace FancyBattles.GameScreen.StateMachine
{
    class TransitionState : State
    {
        private Boolean isGameOver = false;

        public Boolean IsGameOver
        {
            get {return isGameOver;}
        }


        public TransitionState(GameplayScreen parentScreen)
            : base(parentScreen, PlayerIndex.One)
        {
            if (BouncingBitch.FirstBitchesList.Count > 0 && BouncingBitch.SecondBitchesList.Count > 0)
            {
                BouncingBitch.FirstBitchesList.First.Value.IsSelected = true;
                BouncingBitch.SecondBitchesList.First.Value.IsSelected = true;
            }
            else
            {
                isGameOver = true;
            }
        }


        public override void Update(GameTime gameTime)
        {
            Arrow.ClearArrowList();
            if (!isGameOver)
            {
                BouncingBitch.CleanBitches();
                ParentScreen.AltState = new ParState(ParentScreen);
                ParentScreen.ScreenStates[PlayerIndex.One] = new SelectState(ParentScreen, PlayerIndex.One);
                ParentScreen.ScreenStates[PlayerIndex.Two] = new SelectState(ParentScreen, PlayerIndex.Two);
            }
        }

        public override void Draw(GameTime gameTime)
        {
        }
    }
}
